A mobile device can include a motion sensor that is configured to detect a motion of the mobile device. The motion sensor can measure movement and rotation of the mobile device in a two-dimensional or three-dimensional space and provide as an output a series of readings of the acceleration. Based on the motion sensor readings, the mobile device can determine whether the device is or was in motion. The mobile device can use the motion to control various functions or application programs of the mobile device. For example, the mobile device can use the series of readings as an input to an application program. Based on the motion sensor readings, the application program can perform various tasks.